1 <?php
2 session_start();
3 error_reporting(
0);
4 include(
'includes/config.php');
5 if
(isset($_POST['submit50']))
6     {
7 $email=$_POST[
'email'];
8 $mobile=$_POST[
'mobile'];
9 $newpassword=md5($_POST[
'newpassword']);
10     $sql =
"SELECT EmailId FROM tblusers WHERE EmailId=:email and MobileNumber=:mobile";
11 $query= $dbh -> prepare($sql);
12 $query-> bindParam(
':email', $email, PDO::PARAM_STR);
13 $query-> bindParam(
':mobile', $mobile, PDO::PARAM_STR);
14 $query-> execute();
15 $results = $query -> fetchAll(PDO::FETCH_OBJ);

16 if
($query -> rowCount() > 0)
17 {
18 $con=
"update tblusers set Password=:newpassword where EmailId=:email and MobileNumber=:mobile";
19 $chngpwd1 = $dbh->prepare($con);
20 $chngpwd1-> bindParam(
':email', $email, PDO::PARAM_STR);
21 $chngpwd1-> bindParam(
':mobile', $mobile, PDO::PARAM_STR);
22 $chngpwd1-> bindParam(
':newpassword', $newpassword, PDO::PARAM_STR);
23 $chngpwd1->execute();
24 $msg=
"Your Password succesfully changed";
25 }

26 else
{
27 $error=
"Email id or Mobile no is invalid";
28 }
29 }
30
31 ?>
32 <!DOCTYPE HTML>
33 <html>
34 <head>
35 <title>TMS | Tourism Management System</title>
36 <meta name=
"viewport" content="width=device-width, initial-scale=1">
37 <meta http-equiv=
"Content-Type" content="text/html; charset=utf-8" />
38 <meta name=
"keywords" content="Tourism Management System In PHP" />
39 <script type=
"applijewelleryion/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
40 <link href=
"css/bootstrap.css" rel='stylesheet' type='text/css' />
41 <link href=
"css/style.css" rel='stylesheet' type='text/css' />
42 <link href=
'//fonts.googleapis.com/css?family=Open+Sans:400,700,600' rel='stylesheet' type='text/css'>
43 <link href=
'//fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300' rel='stylesheet' type='text/css'>
44 <link href=
'//fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
45 <link href=
"css/font-awesome.css" rel="stylesheet">
46 <!-- Custom Theme files -->
47 <script src=
"js/jquery-1.12.0.min.js"></script>
48 <script src=
"js/bootstrap.min.js"></script>
49 <!--animate-->
50 <link href=
"css/animate.css" rel="stylesheet" type="text/css" media="all">
51 <script src=
"js/wow.min.js"></script>
52     <script>
53          
new WOW().init();
54     </script>
55     <script type=
"text/javascript">
56 function valid()
57 {

58 if
(document.chngpwd.newpassword.value!= document.chngpwd.confirmpassword.value)
59 {
60 alert(
"New Password and Confirm Password Field do not match !!");
61 document.chngpwd.confirmpassword.focus();

62 return
false;
63 }

64 return
true;
65 }
66 </script>
67   <style>
68         .errorWrap {
69     padding: 10px;
70     margin:
0 0 20px 0;
71     background: #fff;
72     border-left: 4px solid #dd3d36;
73     -webkit-box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
74     box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
75 }
76 .succWrap{
77     padding: 10px;
78     margin:
0 0 20px 0;
79     background: #fff;
80     border-left: 4px solid #5cb85c;
81     -webkit-box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
82     box-shadow:
0 1px 1px 0 rgba(0,0,0,.1);
83 }
84         </style>
85 </head>
86 <body>
87 <!-- top-header -->
88 <div
class="top-header">
89 <?php include(
'includes/header.php');?>
90 <div
class="banner-1 ">
91     <div
class="container">
92         <h1
class="wow zoomIn animated animated" data-wow-delay=".5s" style="visibility: visible; animation-delay: 0.5s; animation-name: zoomIn;">TMS-Tourism Management System</h1>
93     </div>
94 </div>
95 <!--- /banner-
1 ---->
96 <!--- privacy ---->
97 <div
class="privacy">
98     <div
class="container">
99         <h3
class="wow fadeInDown animated animated" data-wow-delay=".5s" style="visibility: visible; animation-delay: 0.5s; animation-name: fadeInDown;">Recover Password</h3>
100         <form name=
"chngpwd" method="post" onSubmit="return valid();">
101          <?php
if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div><?php }
102                 
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg); ?> </div><?php }?>
103     <p style=
"width: 350px;">
104         
105             <b>Email id</b> <input type=
"email" name="email" class="form-control" id="email" placeholder="Reg Email id" required="">
106     </p>
107
108     <p style=
"width: 350px;">
109         
110             <b>Mobile No</b> <input type=
"text" name="mobile" class="form-control" id="mobile" placeholder="Reg Mobile no" required="">
111     </p>
112
113 <p style=
"width: 350px;">
114 <b>New Password</b>
115 <input type=
"password" class="form-control" name="newpassword" id="newpassword" placeholder="New Password" required="">
116 </p>
117
118 <p style=
"width: 350px;">
119 <b>Confirm Password</b>
120     <input type=
"password" class="form-control" name="confirmpassword" id="confirmpassword" placeholder="Confrim Password" required="">
121             </p>
122
123             <p style=
"width: 350px;">
124 <button type=
"submit" name="submit50" class="btn-primary btn">Change</button>
125             </p>
126             </form>
127
128         
129     </div>
130 </div>
131 <!--- /privacy ---->
132 <!--- footer-top ---->
133 <!--- /footer-top ---->
134 <?php include(
'includes/footer.php');?>
135 <!-- signup -->
136 <?php include(
'includes/signup.php');?>
137 <!--
//signu -->
138 <!-- signin -->
139 <?php include(
'includes/signin.php');?>
140 <!--
//signin -->
141 <!-- write us -->
142 <?php include(
'includes/write-us.php');?>
143 </body>
144 </html>


Gõ tìm kiếm nhanh...